import React, { useState, useRef, useEffect }  from 'react'
import { Space, Table, Tag, Modal, Button } from 'antd';
import {gethazard} from '@/api/hazard'
const Measurementmanagement = () => {
  const [userdata, setUser] = useState([])
  const columns = [
    {
        title: 'id',
        dataIndex: 'id',
        key: 'id',
    },
    {
        title: '监测序号',
        dataIndex: 'check_id',
        key: 'check_id',
    },
    {
        title: '车主姓名',
        dataIndex: 'name',
        key: 'name',
        render: (text) => <h3>{text}</h3>,
    },
    {
        title: '车牌号',
        dataIndex: 'car_id',
        key: 'car_id',
        render: (text) => <h3>{text}</h3>,
    },
    {
        title: '车检人',
        dataIndex: 'title',
        key: 'title',
        render: (text) => <h3>{text}</h3>,
    },
    {
        title: '车检时间',
        dataIndex: 'birth1',
        key: 'birth1',
    },
    {
        title: '车体状态',
        dataIndex: 'vision1',
        key: 'vision1',
    },
    {
      title: '创建时间',
      dataIndex: 'birth2',
      key: 'birth2',
  },
];
  const getdata = async ()=>{
   let {data:{users}} = await gethazard();
   console.log(users);
   setUser(users)
  }
  useEffect(() => {
    getdata()
}, [])
  return (
    <div>
    <Table columns={columns} dataSource={userdata}
        pagination={{
            pageSize: 6
        }}
        rowKey={item => item.id} />
</div>
  )
}
export default Measurementmanagement